import request from "@/util/request";

export const memberCardCreate = (data) => request({
  url: '/enjooo-api/order/card/create',
  method: 'post',
  data
});

export const orderDetail = (orderId) => request({
  url: '/qichong-record/api/staff/orderDetail',
  params: {
    orderId
  }
});

export const advanceOrderDetail = (orderId) => request({
  url: '/qichong-record/api/staff/advanceOrderDetail',
  params: {
    orderId
  }
});

export const orderDetailByUser = (orderId) => request({
  url: '/qichong-record/api/order/detail',
  params: {
    orderId
  }
});

// 核销会员卡
export const orderCheck = (associatedId, associatedType, shopId, count) => request({
  url: '/qichong-record/api/staff/check',
  method: 'post',
  data: {
    associatedId,
    associatedType,
    shopId,
    count,
  }
});

// 核销消费券
export const activityCheck = (activityId, userId) => request({
  url: '/qichong-record/marketing/activity/taskCheck',
  method: 'post',
  params: {
    activityId,
    userId
  }
});

export const checklog = (userId, current, size) => request({
  url: '/qichong-record/checklog/list',
  params: {
    current,
    size,
    userId
  }
});

export const vipDetailByUser = (userVipId) => request({
  url: '/qichong-record/uservip/vipDetailByUser',
  params: {
    userVipId
  }
});

// 获取用户订单
export const getuserorderList = (status) => request({
  url: '/qichong-record/api/order/page',
  params: status
});

// 获取订单优惠劵
export const getorderCoupons = (items) => request({
  url: '/qichong-record/api/order/availableCoupon',
  method: 'post',
  data: {
    items
  }
})

// 创建订单
export const getordercreate = (params) => request({
  url: '/qichong-record/api/order/create',
  method: 'post',
  data: params
})

// 订单继续支付
export const getordergopay = (id) => request({
  url: '/qichong-record/api/order/miniAppPrepayIdCreateSign',
  params: {
    id
  }
})

// 创建订单
export const orderCreateAdvance = (params) => request({
  url: '/qichong-record/api/order/create/advance',
  method: 'post',
  data: params
})
